Memory tracing in an emulation environment

ABSTRACT

A system and method are disclosed to trace memory in a hardware emulator. In one aspect, a first Random Access Memory is used to store data associated with a user design during emulation. At any desired point in time, the contents of the first Random Access Memory are captured in a second Random Access Memory. After the capturing, the contents of the second Random Access Memory are copied to a visibility system. During the copying, the user design may modify the data in the first Random Access Memory while the captured contents within the second Random Access Memory remain unmodifiable so that the captured contents are not compromised. In another aspect, different size memories are in the emulator to emulate the user model. Larger memories have their ports monitored to reconstruct the contents of the memories, while smaller memories are captured in a snapshot RAM. Together the two different modes of tracing memory are used to provide visibility to the user of the entire user memory.

CROSS REFERENCE TO RELATED APPLICATIONS

This is a 35 U.S.C. §371 U.S. National Stage of InternationalApplication No. PCT/EP2007/051644, filed Feb. 21, 2007, which waspublished in English under PCT Article 21(2), which in turn claims thebenefit of U.S. Provisional Application No. 60/775,494, filed Feb. 21,2006. Both applications are incorporated herein in their entirety.

RELATED APPLICATION DATA

This application claims priority to U.S. provisional application60/775,494 dated Feb. 21, 2006, entitled “Memory Snapshot in anEmulation Environment”, the contents of which are hereby incorporated byreference.

FIELD OF THE INVENTION

The present invention generally relates to hardware emulators, and moreparticularly to tracing memories in a hardware emulator.

BACKGROUND

Today's sophisticated SoC (System on Chip) designs are rapidly evolvingand nearly doubling in size with each generation. Indeed, complexdesigns have nearly exceeded 50 million gates. This complexity, combinedwith the use of devices in industrial and mission-critical products, hasmade complete design verification an essential element in thesemiconductor development cycle. Ultimately, this means that every chipdesigner, system integrator, and application software developer mustfocus on design verification.

Hardware emulation provides an effective way to increase verificationproductivity, speed up time-to-market, and deliver greater confidence inthe final SoC product. Even though individual intellectual propertyblocks may be exhaustively verified, previously undetected problemsappear when the blocks are integrated within the system. Comprehensivesystem-level verification, as provided by hardware emulation, testsoverall system functionality, IP subsystem integrity, specificationerrors, block-to-block interfaces, boundary cases, and asynchronousclock domain crossings. Although design reuse, intellectual property,and high-performance tools all help by shortening SoC design time, theydo not diminish the system verification bottleneck, which consumes60-70% of the design cycle. As a result, designers can implement anumber of system verification strategies in a complementary methodologyincluding software simulation, simulation acceleration, hardwareemulation, and rapid prototyping. But, for system-level verification,hardware emulation remains a favorable choice due to superiorperformance, visibility, flexibility, and accuracy.

A short history of hardware emulation is useful for understanding theemulation environment. Initially, software programs would read a circuitdesign file and simulate the electrical performance of the circuit veryslowly. To speed up the process, special computers were designed to runsimulators as fast as possible. IBM's Yorktown “simulator” was theearliest (1982) successful example of this—it used multiple processorsrunning in parallel to run the simulation. Each processor was programmedto mimic a logical operation of the circuit for each cycle and may bereprogrammed in subsequent cycles to mimic a different logicaloperation. This hardware ‘simulator’ was faster than the currentsoftware simulators, but far slower than the end-product ICs. When FieldProgrammable Gate Arrays (FPGAs) became available in the mid-80's,circuit designers conceived of networking hundreds of FPGAs together inorder to map their circuit design onto the FPGAs and the entire FPGAnetwork would mimic, or emulate, the entire circuit. In the early 90'sthe term “emulation” was used to distinguish reprogrammable hardwarethat took the form of the design under test (DUT) versus a generalpurpose computer (or work station) running a software simulationprogram.

Soon, variations appeared. Custom FPGAs were designed for hardwareemulation that included on-chip memory (for DUT memory as well as fordebugging), special routing for outputting internal signals, and forefficient networking between logic elements. Another variation usedcustom IC chips with networked single bit processors (so-calledprocessor based emulation) that processed in parallel and usuallyassumed a different logic function every cycle.

Physically, a hardware emulator resembles a large server. Racks of largeprinted circuit boards are connected by backplanes in ways that mostfacilitate a particular network configuration. A workstation connects tothe hardware emulator for control, input, and output.

Before the emulator can emulate a DUT, the DUT design must be compiled.That is, the DUT's logic must be converted (synthesized) into code thatcan program the hardware emulator's logic elements (whether they beprocessors or FPGAs). Also, the DUT's interconnections must besynthesized into a suitable network that can be programmed into thehardware emulator. The compilation is highly emulator specific and canbe time consuming.

Once the design is loaded and running in the hardware emulator, it isdesirable to obtain trace data of the states of the various design stateelements and/or other design elements and/or design signals. Such tracedata, also known as user visibility data, is made available to the userand is often used to debug a design. Unfortunately, as the number ofstate elements increases, so to does the amount of trace data. Forexample, an FPGA emulating one hundred thousand state elements couldgenerate up to one hundred thousand bits, or 0.1 Mb, of trace data perclock cycle. The elements that are traced can be divided into three maincategories: flip-flops, glue logic, and RAM. Each of these categorieshas its own unique tracing problems, but all are limited by the size ofa trace buffer into which data is stored. Because of the large amount ofdata needed to be captured over a large number of clock cycles, someelements are captured only at pre-determined intervals (e.g., every 1000clock cycles) and if a user requests to view a particular interval, anyuncaptured cycles can be simulated and regenerated in order to completethe entire trace period. For example, flip-flops may be captured onceevery 1000 cycles and that captured data may be used to simulate theother flip-flop states as well as the glue logic.

While such simulation works well with flip-flops and glue logic, memorymust be captured every clock cycle. For example, a user wanting to viewthe contents of memory at a particular trace cycle cannot rely onsimulation generated using a memory captured only once every 1000cycles. If the memory contents change every cycle, such changes will belost and unrecoverable. Another difficult issue with memory is themanner of tracing used. During emulation, the memory is constantlyaccessed. In order to view the memory, it is not possible to switch offthe memory or the emulator and download the memory contents. Thus,current systems monitor the memory ports in order to trace changes thatoccurred in the memory, similar to shadow memories known in the art.Knowledge of the original contents of memory and how it changed can beused to accurately recreate the memory contents.

A problem with tracing read ports is that every user cycle, memory datacontinuously accumulates until a cross-over point where the datacaptured to duplicate the memory exceeds the memory size itself.Continued tracing beyond the cross-over point means that it would havebeen more efficient to have a duplicate memory. Additionally, as userdesigns continue to become larger and more complex, the memory size isincreasing, requiring the trace buffer to monitor more memory ports.With this trend continuing, it is desirable to re-think how memory canbe more efficiently traced without over-burdening the trace system.

SUMMARY

A system and method are disclosed to trace memory in a hardwareemulator.

In one aspect, a first Random Access Memory is used to store dataassociated with a user design during emulation. At any desired point intime, the contents of the first Random Access Memory are captured in asecond Random Access Memory. After the capturing, the contents of thesecond Random Access Memory are copied to another location. During thecopying, the user design may modify the data in the first Random AccessMemory while the captured contents within the second Random AccessMemory remain unmodifiable so that the captured contents are notcompromised.

In another aspect, different size memories within the emulator are usedto emulate the user model. Larger memories have their ports monitored toreconstruct the contents of the memories, while smaller memories arecaptured in a snapshot RAM. Together the two different modes of tracingmemory are used to provide visibility to the user of the entire usermemory.

These features and others of the described embodiments will be morereadily apparent from the following detailed description, which proceedswith reference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a system diagram of a hardware emulator environment.

FIG. 2 shows details of a visibility system in the hardware emulator ofFIG. 1.

FIG. 3 shows a hardware diagram of an FPGA or ASIC located on a printedcircuit board within the hardware emulator.

FIG. 4 is a flowchart of a method for capturing the contents of a memorywithin the emulator environment, without disturbing the emulation.

FIG. 5 is a more detailed flowchart of a method for viewing the contentsof the memory within the emulator.

FIG. 6 is a hardware diagram showing an FPGA or ASIC located on aprinted circuit board within the hardware emulator with a visibilitysystem monitoring the ports of some memories and using a snapshot memoryfor tracing other memories.

FIG. 7 is a flowchart of a method for providing visibility to users ofboth large and small memories.

FIG. 8 is a hardware diagram showing the interrelationship between auser memory and snapshot memory.

FIG. 9 is a particular hardware embodiment showing the user memory andsnapshot memory at the bit level.

FIG. 10 is another embodiment showing the user memory and the snapshotmemory.

DETAILED DESCRIPTION

FIG. 1 shows an emulator environment 10 including a hardware emulator 12coupled to a hardware emulator host 14. The emulator host 14 may be anydesired type of computer hardware and generally includes a userinterface through which a user can load, compile and download a designto the emulator 12 for emulation. The user can also view the traceresults of a visibility system through the host 14, as described furtherbelow.

The emulator 12 includes multiple printed circuit boards 16 coupled to amidplane 18. The midplane 18 allows physical connection of the printedcircuit boards into the emulator 12 on both sides of the midplane. Abackplane may also be used in place of the midplane, the backplaneallowing connection of printed circuit boards on one side of thebackplane. Any desired type of printed circuit boards may be used. Forexample, programmable boards 20 generally include an array of FPGAs, orother programmable circuitry, that may be programmed with the user'sdesign downloaded from the emulator host 14. One or more I/O boards 22allow communication between the emulator 12 and hardware external to theemulator. For example, the user may have a preexisting processor boardthat is used in conjunction with the emulator and such a processor boardconnects to the emulator through I/O board 22. Clock board 24 generatesany number of desired clock signals. And interconnect boards 26 allowintegrated circuits on the programmable boards 20 to communicatetogether and with integrated circuits on the I/O boards 22.

FIG. 2 shows further details of one of the printed circuit boards 16 andthe interaction with a visibility system 40. The visibility systemallows a user to set certain events or triggers 42 detected throughprobes 44 coupled to programmable blocks 38 on the printed circuit board16. If a trigger is activated, data related to the board's operation isstored in a trace memory 46. A visibility buffer 48 is coupled to thetrace memory and is used by software on the emulation host 14 to displaythe trace results to the user.

FIG. 3 shows further details of a portion of a programmable block that,in this case, is an FPGA 60 (an ASIC may also be used in place of theFPGA). The FPGA is an integrated circuit within an IC package of anydesired type. In order to implement a user design within an emulator,the FPGA can be thought of as having three groups of digital logic:flip-flops 62, glue logic 64, and RAM 66. In order to trace events thatoccur within the digital logic, a visibility system control logic block70 (that is part of the visibility system 40) receives inputs fromflip-flops 62, glue logic 64 and the memory 66. The visibility block 70then passes this information regarding state through I/O pins 72 on theIC package to the trace memory 46.

The RAM 66 in FIG. 3 includes two separate types of RAM: a standard RAM74, which is used by the user model to emulate the user's design, and asnapshot RAM 76, which is used to capture the contents of RAM 74 at anydesired moment in time. Rather than monitor the ports of RAM 74directly, the visibility system control logic 70 receives informationregarding the contents of RAM 74 via the snapshot RAM 76. As describedfurther below, the snapshot RAM takes an instantaneous picture of thecontents of RAM by making a duplicate copy thereof. The control logictransmits the contents received from the snapshot RAM 76 to the tracememory 46 via the I/O pins 72. By not monitoring the ports of RAM 74directly on every clock cycle, the bandwidth of the visibility systemcontrol logic 70 is increased. Instead, the instantaneous content of theRAM 74 can be captured in the snapshot RAM 76 and downloaded to thevisibility system control logic over many clock cycles.

FIG. 4 shows a flowchart of a method for illustrating how the contentsof the RAM 74 can be displayed to the user. In process block 90, a firstmemory is used to emulate the user design. For example, RAM 74 in FIG. 3may be used to emulate the user design. In process block 92, a copy ofthe first memory is captured in a second memory. The copy captured is aninstantaneous copy, such that the content of the first memory is lockedor cannot be changed until the copy to the second memory is complete. Inprocess 94, the contents of the second memory are downloaded to thevisibility system in order to display the contents of the first memoryto the user. During the downloading of the contents of the secondmemory, the first memory may be modified so emulation is not effected.However, the second memory remains unmodifiable so that theinstantaneous snapshot of the first memory contents is not compromised.

FIG. 5 shows a more detailed flowchart of a method for providingvisibility to a user. In process block 110, a first memory is used toemulate a user design. Thus, the user design requires a memory, such asRAM that can be written to and read from. In process block 112, theentire contents of the first memory are captured in a second memorywithout stopping the emulation. The user model does not have access tothe second memory. Instead, the second memory is only available to makean instantaneous copy of the first memory. While the first memory isbeing captured, the contents of the first memory cannot be changed. Insome embodiments described below, it is possible to copy the firstmemory in one emulator clock cycle so that the user model does not havetime to change the first memory before the copy is completed. In otherembodiments, it is desirable to lock the first memory or cache thedesired changes until the entire copy is made. After the second memoryhas captured the contents of the first memory, the first memory may bemodified by the user model. However, as indicated in process block 114,the second memory maintains the captured contents and is not modified.In process block 116, the contents of the second memory are downloadedover many clock cycles to the visibility system. Thus, the visibilitysystem is not overburdened by continuously monitoring the first memory,but instead can receive the snapshot of the first memory over anydesired period of time. In process block 118, a user may request, viathe emulation host 14, to view the contents of the first memory at apoint in time decided by the user. In process block 120, the user designis simulated using multiple snapshots of the first memory acquiredduring the emulation to reconstruct contents of the memory at the pointin time decided by the user.

FIG. 6 shows another hardware embodiment wherein two different sizememories within the same FPGA or ASIC 140 are used by the user model. Agroup of memories 142 is used by the user model as RAM. Any size RAM maybe used (e.g., 512K) depending on the application. The group of memories142 include ports 144 that are monitored by a visibility control system146, which is part of the visibility system 40. Flip-flops 148 and gluelogic 150 are also within the IC 140 as already described. A secondmemory (or group of memories) 152 is smaller (e.g., 4K) than thememories 142. This second memory 152 has a port (not shown) that is notmonitored by the visibility system. Instead, the visibility systemreceives information regarding the second memory 152 through a snapshotmemory 154. And rather than monitoring the port of the snapshot memory154, the contents thereof are directly downloaded to the visibilitysystem control logic 146. Thus, two different size RAMs are present inthe same IC and are accessible from the user model. However, there aretwo different techniques for monitoring the memories. The first group ofmemories 142 is monitored through their ports 144, while the secondmemory 152 is monitored through the snapshot memory 154. Once all thedata is captured by the visibility system control logic 146, it ispassed to the trace memory 46 via the I/O pins 156.

FIG. 7 shows a flowchart of a method for tracing the memories in thesystem of FIG. 6. In process block 170, large memories are used toemulate the user model. At the same time, smaller memories (e.g., 50-200times smaller) are used to emulate the user model (process block 172).In process block 174, the visibility system monitors the ports of thelarge memories in order to trace the memory contents. In process block176, instead of monitoring ports, one or more snapshot memories are usedto capture the contents of the smaller memories. In process block 178,the visibility system receives the contents of the smaller memoriesthrough the snapshot memories. In process block 180, visibility of boththe large and small memories is seamlessly provided to the user.

FIG. 8 is a high-level diagram 200 showing the interaction between a RAM202 located on one of the printed circuit boards 16, a user model 204and the visibility system 40. The user model 204 represents the systembeing emulated in the hardware emulator 12 by the user. The user model204 accesses RAM 202, which includes a user model portion 206, transferhardware 208, and a snapshot portion 210. The user model portion 206 isdirectly readable and writeable by the user model 204. However, in orderto not overburden the visibility system, the visibility system 40accesses the user model portion 206 via the snapshot portion 210. At anydesired moment in time, a copy signal line 212 coupled to the transferhardware 208 can effectuate a block copy of the contents of the usermodel portion 206 of the RAM 202 to the snapshot portion 210. Thesecontents can then be downloaded to the visibility system over many clockcycles and show the state of the user model portion 206 at substantiallythe moment of activation of the copy signal. The RAM 202 may be oneintegrated RAM or include several separate memories.

FIG. 9 shows an example of a user memory type cell 216 of the user modelportion 206 and a snapshot memory type cell 218 of the snapshot portion210 coupled together by transfer hardware 208. In this embodiment,memory cell 216 includes back-to-back inverters 220, 222 coupledtogether in a continuous loop. A first word line WL 224 allows data tobe written to or read from memory cell 216 by switching on opposingtransistors 230, 232 and allowing data to be driven from or received tobit lines BL 234 and BLn 236 (inverted BL). The word line WL 224 and bitlines BL 234, BLn 236 are accessible by the user model 204. The snapshottype memory cell 218 has a similar back-to-back inverter structure usinginverters 240, 242. A second word line WLS 244 and separate bit lines246, 248 allow access to the snapshot memory cell 218. The copy signalline 212 activates two transistors 250, 252 that form a switch and allowdata to be copied from the user memory cell 216 to the snapshot memorycell 218. As described further below, there are many techniques toensure that the data is copied from memory cell 216 to memory cell 218and not vice versa. One technique is to ensure that user memory typecells are larger than snapshot type memory cells. By having separateword lines and separate bit lines, both memory cells 216, 218 can beoperated independently of each other as they function as completelyseparate memories, although physically they are formed on the samesilicon and located in the same chip. For example, the RAM may be usedto perform a block copy of all the user memory-type memory cells to thesnapshot-type memory cells within one emulator clock cycle. Thesnapshot-type memory cells may then be read at the same time that newdata is being written to the user memory cells without either memoryportion disturbing the operation of the other portion. Thus, the usermemory-type memory cells represent the primary memory cells of thememory while the snapshot-type memory cells represent an instantaneouscopy of the primary memory cells. The instantaneous copy may thereafterbe passed to the visibility system over many clock cycles to notoverburden the visibility system.

FIG. 10 shows another embodiment that may be used to transfer contentsof a user model RAM 270 to a snapshot RAM 272 via transfer hardware 274.In this embodiment, a cache 276 is used to buffer memory accesses fromthe user model 278 while the contents of the user model RAM 270 istransferred to the snapshot RAM 272 in response to activation of a copyline 280. After the transfer is complete, the cache 276 is used toupdate the contents of the user model RAM 270.

Having illustrated and described the principles of the illustratedembodiments, it will be apparent to those skilled in the art that theembodiments can be modified in arrangement and detail without departingfrom such principles.

Although two embodiments are shown to transfer data from the user modelportion of RAM to the snapshot RAM, there are numerous techniques formaking such a transfer as well understood in the art, and any othertechnique may easily be substituted to perform such a transfer.

In view of the many possible embodiments, it will be recognized that theillustrated embodiments include only examples of the invention andshould not be taken as a limitation on the scope of the invention.Rather, the invention is defined by the following claims. We thereforeclaim as the invention all such embodiments that come within the scopeof these claims.

1. A method of tracing memory in a hardware emulator, comprising:identifying a first Random Access Memory, the first Random Access Memoryhaving data associated with a user design during emulation and resultingfrom a plurality of write requests stored thereon; capturing a copy ofthe contents of the first Random Access Memory at a point in time in aseparate second Random Access Memory; and copying the captured contentsfrom the second Random Access Memory for the purpose of tracing memory,during which time the user design may modify the data in the firstRandom Access Memory while the captured contents within the secondRandom Access Memory remain unmodifiable.
 2. The method of claim 1,wherein the capturing occurs in one clock cycle of the emulator.
 3. Themethod of claim 1, wherein the capturing occurs without stoppingemulation of the user design.
 4. The method of claim 1, wherein thesecond memory is not accessible by the user design.
 5. The method ofclaim 1, wherein the capturing includes copying the entire contents ofthe first memory to the second memory in response to activation of acopy signal line.
 6. The method of claim 1, wherein copying the capturedcontents includes copying the entire contents of the second memory to atrace memory.
 7. The method of claim 6, further including preventing anychanges to the second memory and wherein copying includes copyingpredetermined blocks of data over multiple clock cycles to a visibilitysystem until the contents of the second memory is copied.
 8. The methodof claim 1, further including receiving a user request to view thecontents of the first Random Access Memory at a point in time andsimulating the user design using the contents received from the secondRandom Access Memory to reconstruct the contents of the first RandomAccess Memory at the point in time.
 9. The method of claim 1, whereinthe first and second Random Access Memories have different physicaladdresses within the emulator, but are located within the sameintegrated circuit package.
 10. A hardware emulator, comprising: a firstRandom Access Memory used to emulate a user design; a separate secondRandom Access Memory coupled to the first Random Access Memory, a copysignal line coupled to both the first Random Access Memory and thesecond Random Access Memory for copying the entire contents of the firstmemory to the second memory; and a visibility system coupled to thesecond Random Access Memory and not coupled to the first Random AccessMemory, the visibility system allowing a user to view the contents ofthe first Random Access Memory.
 11. The hardware emulator of claim 10,wherein the first Random Access Memory and the second Random AccessMemory are located within the same integrated circuit.
 12. The hardwareemulator of claim 10, wherein the first Random Access Memory (RAM) is ina first group of RAMs used to emulate a user design, each RAM having afirst size; further including: a second group of RAMs used to emulate auser design, each RAM in the second group being a size larger than theRAMs in the first group; the visibility system coupled to the ports ofthe second group of RAMs for monitoring the contents thereof.
 13. Thehardware emulator of claim 10, wherein the first Random Access Memoryincludes multiple memory cells and the second Random Access Memoryincludes multiple memory cells and each memory cell of the first RandomAccess Memory is individually coupled to a corresponding memory cell inthe second Random Access Memory in a one-to-one correspondence.
 14. Thehardware emulator of claim 13, wherein each memory cell of the firstRandom Access Memory is coupled to a corresponding memory cell of thesecond Random Access Memory through a transistor coupled to a copy line.15. The hardware emulator of claim 13, wherein a memory cell includestwo inverters coupled in series.
 16. The hardware emulator of claim 10,further including a cache coupled to the first Random Access Memory, thecache activated only during a copy from the first Random Access Memoryto the second Random Access Memory.
 17. A method of tracing memory in ahardware emulator, comprising: emulating a memory of a user design usinga first emulator memory; and providing a separate second emulator memoryused for visibility of the first emulator memory, the second emulatormemory not always being a copy of the first memory during emulation, butat any point in time, an instantaneous copy is made to capture theentire first emulator memory contents in the second emulator memory. 18.The method of claim 17, wherein the instantaneous copy occurs in oneemulation clock cycle.
 19. The method of claim 17, further comprisingdownloading the contents of the second emulator memory to an emulatorvisibility system over many emulator clock cycles.
 20. The method ofclaim 17, further including modifying the first emulator memory duringemulation without modifying the second emulator memory.